/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gob.fonafe.dao.impl.stored;

import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.core.SqlOutParameter;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.StoredProcedure;

/**
 *
 * @author czela
 */
public class DesagregarBienesSubastaPublicadaSP extends StoredProcedure{

    private static final String PROC_PARAM="USERGLC.P_DESAC_BIENES_SUB_PUBLICADO";

    public DesagregarBienesSubastaPublicadaSP(DataSource ds) {
        super(ds, PROC_PARAM);

        declareParameter(new SqlParameter("P_id_clase_subasta", Types.NUMERIC));
        declareParameter(new SqlParameter("P_ID_BIEN", Types.NUMERIC));
        declareParameter(new SqlOutParameter("V_MENSAJE", Types.VARCHAR));
        declareParameter(new SqlOutParameter("V_EXITO", Types.VARCHAR));
        compile();
    }

    public Map execute(String idClase,String idBien){
        Map inputs = new HashMap();
        System.out.println("IdClase [" + idClase + "]");
        System.out.println("IdBien [" + idBien + "]");
        if(idClase != null){
        inputs.put("P_id_clase_subasta", Integer.valueOf(idClase));
        }
        if(idBien != null){
        inputs.put("P_ID_BIEN", Integer.valueOf(idBien));
        }
        return super.execute(inputs);
    }





}
